import { createSlice, type PayloadAction } from "@reduxjs/toolkit";
import type { Type } from "../types/type";

const typeSlice = createSlice({
    name:"type",
    initialState:{
        typeList:[] as Type[]
    },
    reducers: {
        setTypeList(state, action: PayloadAction<Type[]>){
            return{
                ...state,
                typeList: action.payload
            }
        }
    }
})

export const {setTypeList} = typeSlice.actions
export const typeReducer = typeSlice.reducer